function formatTime(date)
{
  var year = date.getFullYear();//从Date对象以四位数字返回年份
  var month = date.getMonth() + 1;//从Date对象返回月份(0~11)
  var day = date.getDate();//从Date对象返回一个月中的某一个(1~31)

  var hour = date.getHours();//返回Date对象的小时(0~23)
  var minute = date.getMinutes();//返回Date对象的分钟(0~59)
  var second = date.getSeconds();//返回Date对象的秒数

  return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':');
}

function hourtime(date)
{
  var hour = date.getHours();//返回Date对象的小时(0~23)
  var minute = date.getMinutes();//返回Date对象的分钟(0~59)
  var second = date.getSeconds();//返回Date对象的秒数

  var msg = hour.toString() + ":" + minute.toString() + ":" + second.toString();
  return msg;
}

function formatNumber(n)
{
  n = n.toString();
  return n[1] ? n : '0' + n;
}

module.exports = {
  formatTime: formatTime,
  hourtime: hourtime
}